//
//  NetworkTool.swift
//  zyqWeibo
//
//  Created by 张亚琼 on 15/6/27.
//  Copyright © 2015年 张亚琼. All rights reserved.
//

import UIKit
import AFNetworking

class NetworkTool: AFHTTPSessionManager {
    
    private static let instance: NetworkTool = {
        let urlString = "https://api.weibo.com/"
        let baseUrl = NSURL(string: urlString)
        let tool = NetworkTool(baseURL: baseUrl)
        
        // 设置相应的默认反序列化格式
        tool.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as! Set<String>
        return tool

    }()
    
    class func sharedNetworkTool() -> NetworkTool {
        return instance
    }
    
}
